import { init } from "snabbdom/build/package/init";
import { h } from "snabbdom/build/package/h";
import { styleModule } from "snabbdom/build/package/modules/style";
import { eventListenersModule } from "snabbdom/build/package/modules/eventlisteners";

let patch = init([styleModule, eventListenersModule]);

const app = document.querySelector("#app");

let vnode = h(
    "div.cls",
    {
        style: {
            fontWeight: "bold",
            color: "red",
        },
        on: {
            click: eventHandler,
        },
        name: "123123",
        key: 1
    },
    [
        1111,
        h(
            "h1",
            {
                on: {
                    click: event => {
                        event.stopPropagation();
                    },
                },
            },
            "aaaaaa"
        ),
        h("h2", "bbbbbb"),
    ]
);

function eventHandler() {
    console.log(1233);
}

let oldVnode = patch(app, vnode);
console.log(oldVnode);